package com.scau402.system.domain;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.scau402.common.core.domain.entity.SysUser;
import com.scau402.common.annotation.Excel;
import com.scau402.common.core.domain.BaseEntity;

/**
 * 商品入库单对象 wms_inbound_order
 * 
 * @author ruoyi
 * @date 2023-06-26
 */
public class WmsInboundOrder extends BaseEntity
{
    /**
     * 序列化版本ID
     */
    private static final long serialVersionUID = 1L;

    private String codeRule;

    private Long returnQuantity;

    private Long notReturnQuantity;

    private List<WmsJade> jades = new ArrayList<>();

    private List<WmsBasicClient> clients = new ArrayList<>();

    private String inboundTypeName;

    private String warehouseName;

    private String storageName;

    private String processorName;

    private String jadeTypeName;

    public List<WmsJade> getJades() {
        return jades;
    }

    public void setJades(List<WmsJade> jades) {
        this.jades = jades;
    }

    public String getInboundTypeName() {
        return inboundTypeName;
    }

    public void setInboundTypeName(String inboundTypeName) {
        this.inboundTypeName = inboundTypeName;
    }


    public String getWarehouseName() {
        return warehouseName;
    }

    public void setWarehouseName(String warehouseName) {
        this.warehouseName = warehouseName;
    }

    public String getStorageName() {
        return storageName;
    }

    public void setStorageName(String storageName) {
        this.storageName = storageName;
    }

    public String getProcessorName() {
        return processorName;
    }

    public void setProcessorName(String processorName) {
        this.processorName = processorName;
    }

    public String getJadeTypeName() {
        return jadeTypeName;
    }

    public void setJadeTypeName(String jadeTypeName) {
        this.jadeTypeName = jadeTypeName;
    }


    private String merged;

    public String getMerged() {
        return merged;
    }

    public void setMerged(String merged) {
        this.merged = merged;
    }

    /** id */
    private Long id;

    /** 入库类型 */
    @Excel(name = "入库类型")
    private String orderType;

    /** 入库单编号 */
    @Excel(name = "入库单编号")
    private String orderCode;

    /** 订单批次 */
    @Excel(name = "订单批次")
    private String orderBatch;

    /** 订单日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date orderDate;

    /** 有效期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date validDate;


    /** 供应商列表 **/
    private List<WmsBasicSupplier> suppliers = new ArrayList<>();

    /** 入库用户列表 **/
    private List<SysUser> users = new ArrayList<>();

    /** 入库仓位主键ID */
    @Excel(name = "入库仓位主键ID")
    private Long desStorageId;

    /** 入库仓库主键ID */
    @Excel(name = "入库仓库主键ID")
    private Long desWarehouseId;

    /** 加工厂主键ID */
    @Excel(name = "加工厂主键ID")
    private Long processorId;

    /** 关联出库单主键 */
    @Excel(name = "关联出库单主键")
    private Long outboundOrderId;

    /** 条形码 */
    @Excel(name = "条形码")
    private String barcode;

    /** 翡翠品类id */
    @Excel(name = "翡翠品类id")
    private Long jadeTypeId;

    /** 翡翠重量 */
    @Excel(name = "翡翠重量")
    private BigDecimal jadeWeight;

    /** 翡翠数量 */
    @Excel(name = "翡翠数量")
    private Long jadeQuantity;

    /** 翡翠成本价格 */
    @Excel(name = "翡翠成本价格")
    private BigDecimal jadeCost;

    /** 翡翠标签价格 */
    @Excel(name = "翡翠标签价格")
    private BigDecimal jadeTagPrice;

    public BigDecimal getJadeMarketPrice() {
        return jadeMarketPrice;
    }

    public void setJadeMarketPrice(BigDecimal jadeMarketPrice) {
        this.jadeMarketPrice = jadeMarketPrice;
    }

    public BigDecimal getJadeSupplyPrice() {
        return jadeSupplyPrice;
    }

    public void setJadeSupplyPrice(BigDecimal jadeSupplyPrice) {
        this.jadeSupplyPrice = jadeSupplyPrice;
    }

    public String getJadeCostCipher() {
        return jadeCostCipher;
    }

    public void setJadeCostCipher(String jadeCostCipher) {
        this.jadeCostCipher = jadeCostCipher;
    }

    public String getJadeTagPriceCipher() {
        return jadeTagPriceCipher;
    }

    public void setJadeTagPriceCipher(String jadeTagPriceCipher) {
        this.jadeTagPriceCipher = jadeTagPriceCipher;
    }

    public String getCustomType() {
        return customType;
    }

    public void setCustomType(String customType) {
        this.customType = customType;
    }

    /** 翡翠市场价格 */
    @Excel(name = "翡翠市场价格")
    private BigDecimal jadeMarketPrice;

    /** 翡翠供货价格 */
    @Excel(name = "翡翠供货价格")
    private BigDecimal jadeSupplyPrice;

    /** 成本价暗码 */
    @Excel(name = "成本价暗码")
    private String jadeCostCipher;

    /** 标签价暗码 */
    @Excel(name = "标签价暗码")
    private String jadeTagPriceCipher;

    /** 自定义规格 */
    @Excel(name = "自定义规格")
    private String customType;

    /** 是否需要复核（0不需要 1需要） */
    @Excel(name = "是否需要复核", readConverterExp = "0=不需要,1=需要")
    private String isReview;

    /** 复核用户ID */
    @Excel(name = "复核用户ID")
    private Long reviewUserId;

    /** 是否通过复核（0通过 1不通过） */
    @Excel(name = "是否通过复核", readConverterExp = "0=通过,1=不通过")
    private String isReviewOk;

    /** 复核时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "复核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date reviewTime;

    /** 状态 */
    @Excel(name = "状态")
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 租户ID */
    @Excel(name = "租户ID")
    private Long tenantId;

    /** 部门ID */
    @Excel(name = "部门ID")
    private Long deptId;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setOrderType(String orderType) 
    {
        this.orderType = orderType;
    }

    public String getOrderType() 
    {
        return orderType;
    }
    public void setOrderCode(String orderCode) 
    {
        this.orderCode = orderCode;
    }

    public String getOrderCode() 
    {
        return orderCode;
    }
    public void setOrderBatch(String orderBatch) 
    {
        this.orderBatch = orderBatch;
    }

    public String getOrderBatch() 
    {
        return orderBatch;
    }
    public void setOrderDate(Date orderDate) 
    {
        this.orderDate = orderDate;
    }

    public Date getOrderDate() 
    {
        return orderDate;
    }
    public void setValidDate(Date validDate) 
    {
        this.validDate = validDate;
    }

    public Date getValidDate() 
    {
        return validDate;
    }

    public void setDesStorageId(Long desStorageId) 
    {
        this.desStorageId = desStorageId;
    }

    public Long getDesStorageId() 
    {
        return desStorageId;
    }
    public void setDesWarehouseId(Long desWarehouseId) 
    {
        this.desWarehouseId = desWarehouseId;
    }

    public Long getDesWarehouseId() 
    {
        return desWarehouseId;
    }
    public void setProcessorId(Long processorId) 
    {
        this.processorId = processorId;
    }

    public Long getProcessorId() 
    {
        return processorId;
    }
    public void setOutboundOrderId(Long outboundOrderId) 
    {
        this.outboundOrderId = outboundOrderId;
    }

    public Long getOutboundOrderId() 
    {
        return outboundOrderId;
    }
    public void setBarcode(String barcode) 
    {
        this.barcode = barcode;
    }

    public String getBarcode() 
    {
        return barcode;
    }
    public void setJadeTypeId(Long jadeTypeId)
    {
        this.jadeTypeId = jadeTypeId;
    }

    public Long getJadeTypeId()
    {
        return jadeTypeId;
    }
    public void setJadeWeight(BigDecimal jadeWeight) 
    {
        this.jadeWeight = jadeWeight;
    }

    public BigDecimal getJadeWeight() 
    {
        return jadeWeight;
    }
    public void setJadeQuantity(Long jadeQuantity)
    {
        this.jadeQuantity = jadeQuantity;
    }

    public Long getJadeQuantity()
    {
        return jadeQuantity;
    }
    public void setJadeCost(BigDecimal jadeCost) 
    {
        this.jadeCost = jadeCost;
    }

    public BigDecimal getJadeCost() 
    {
        return jadeCost;
    }
    public void setJadeTagPrice(BigDecimal jadeTagPrice) 
    {
        this.jadeTagPrice = jadeTagPrice;
    }

    public BigDecimal getJadeTagPrice() 
    {
        return jadeTagPrice;
    }

    public void setIsReview(String isReview) 
    {
        this.isReview = isReview;
    }

    public String getIsReview() 
    {
        return isReview;
    }
    public void setReviewUserId(Long reviewUserId) 
    {
        this.reviewUserId = reviewUserId;
    }

    public Long getReviewUserId() 
    {
        return reviewUserId;
    }
    public void setIsReviewOk(String isReviewOk) 
    {
        this.isReviewOk = isReviewOk;
    }

    public String getIsReviewOk() 
    {
        return isReviewOk;
    }
    public void setReviewTime(Date reviewTime) 
    {
        this.reviewTime = reviewTime;
    }

    public Date getReviewTime() 
    {
        return reviewTime;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }
    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }
    public void setTenantId(Long tenantId) 
    {
        this.tenantId = tenantId;
    }

    public Long getTenantId() 
    {
        return tenantId;
    }
    public void setDeptId(Long deptId) 
    {
        this.deptId = deptId;
    }

    public Long getDeptId() 
    {
        return deptId;
    }

    public List<WmsBasicSupplier> getSuppliers() {
        return suppliers;
    }

    public void setSuppliers(List<WmsBasicSupplier> suppliers) {
        this.suppliers = suppliers;
    }

    public List<SysUser> getUsers() {
        return users;
    }

    public void setUsers(List<SysUser> users) {
        this.users = users;
    }

    public List<WmsBasicClient> getClients() {
        return clients;
    }

    public void setClients(List<WmsBasicClient> clients) {
        this.clients = clients;
    }

    public Long getReturnQuantity() {
        return returnQuantity;
    }

    public void setReturnQuantity(Long returnQuantity) {
        this.returnQuantity = returnQuantity;
    }

    public Long getNotReturnQuantity() {
        return notReturnQuantity;
    }


    public void setNotReturnQuantity(Long notReturnQuantity) {
        this.notReturnQuantity = notReturnQuantity;
    }

    /**
     * 获取入库单翡翠总数量
     * @return
     */
    public Long getTotalQuantity() {
        Long total = 0l;
        for(WmsJade jade : jades) {
            total += jade.getJadeQuantity();
        }
        return total;
    }

    /**
     * 获取入库单翡翠总成本价
     * @return
     */
    public BigDecimal getTotalJadeCost() {
        BigDecimal total = new BigDecimal(0);
        for(WmsJade jade : jades) {
            total = jade.getJadeCost().add(total);
        }
        return total;
    }

    /**
     * 获取入库单翡翠总标签价
     * @return
     */
    public BigDecimal getTotalJadeTagPrice() {
        BigDecimal total = new BigDecimal(0);
        for(WmsJade jade : jades) {
            total = jade.getJadeTagPrice().add(total);
        }
        return total;
    }

    /**
     * 获取入库单翡翠总市场价
     * @return
     */
    public BigDecimal getTotalJadeMarketPrice() {
        BigDecimal total = new BigDecimal(0);
        for(WmsJade jade : jades) {
            if(jade.getJadeMarketPrice() != null) {
                total = jade.getJadeMarketPrice().add(total);
            }
        }
        return total;
    }

    /**
     * 获取入库单翡翠总供货价
     * @return
     */
    public BigDecimal getTotalJadeSupplyPrice() {
        BigDecimal total = new BigDecimal(0);
        for(WmsJade jade : jades) {
            if(jade.getJadeSupplyPrice() != null) {
                total = jade.getJadeSupplyPrice().add(total);
            }
        }
        return total;
    }

    public Long getTotalReturnQuantity() {
        Long total = 0L;
        for(WmsJade jade : jades) {
            total += jade.getReturnQuantity();
        }
        return total;
    }


    public Long getTotalNotReturnQuantity() {
        Long total = 0L;
        for(WmsJade jade : jades) {
            total += jade.getNotReturnQuantity();
        }
        return total;
    }

    public String getCodeRule() {
        return codeRule;
    }

    public void setCodeRule(String codeRule) {
        this.codeRule = codeRule;
    }

    @Override
    public String toString() {
        return "WmsInboundOrder{" +
                "returnQuantity=" + returnQuantity +
                ", notReturnQuantity=" + notReturnQuantity +
                ", jades=" + jades +
                ", clients=" + clients +
                ", inboundTypeName='" + inboundTypeName + '\'' +
                ", warehouseName='" + warehouseName + '\'' +
                ", storageName='" + storageName + '\'' +
                ", processorName='" + processorName + '\'' +
                ", jadeTypeName='" + jadeTypeName + '\'' +
                ", merged='" + merged + '\'' +
                ", id=" + id +
                ", orderType='" + orderType + '\'' +
                ", orderCode='" + orderCode + '\'' +
                ", orderBatch='" + orderBatch + '\'' +
                ", orderDate=" + orderDate +
                ", validDate=" + validDate +
                ", suppliers=" + suppliers +
                ", users=" + users +
                ", desStorageId=" + desStorageId +
                ", desWarehouseId=" + desWarehouseId +
                ", processorId=" + processorId +
                ", outboundOrderId=" + outboundOrderId +
                ", barcode='" + barcode + '\'' +
                ", jadeTypeId=" + jadeTypeId +
                ", jadeWeight=" + jadeWeight +
                ", jadeQuantity=" + jadeQuantity +
                ", jadeCost=" + jadeCost +
                ", jadeTagPrice=" + jadeTagPrice +
                ", jadeMarketPrice=" + jadeMarketPrice +
                ", jadeSupplyPrice=" + jadeSupplyPrice +
                ", jadeCostCipher='" + jadeCostCipher + '\'' +
                ", jadeTagPriceCipher='" + jadeTagPriceCipher + '\'' +
                ", customType='" + customType + '\'' +
                ", isReview='" + isReview + '\'' +
                ", reviewUserId=" + reviewUserId +
                ", isReviewOk='" + isReviewOk + '\'' +
                ", reviewTime=" + reviewTime +
                ", status='" + status + '\'' +
                ", delFlag='" + delFlag + '\'' +
                ", tenantId=" + tenantId +
                ", deptId=" + deptId +
                '}';
    }

}
